<template>
	<view class="gmzn">
		<up-parse :content="content"></up-parse>
	</view>
</template>

<script setup>
	import {
		onLoad,
		onShow,
		onPageScroll,
		onReachBottom
	} from "@dcloudio/uni-app";
	import {
		article
	} from '@/api/home.js'
	import {
		ref
	} from 'vue';
	const content = ref(``);
	const id = ref(``);
	onLoad((opt) => {
		if (opt.typestr == '服务协议') {
			id.value = 3
		}
		if (opt.typestr == '会员协议') {
			id.value = 2
		} else if (opt.typestr != '服务协议') {
			id.value = 1
		}
		init()
	})
	async function init() {
		const res = await article({
			id: id.value
		})
		if (res.code == 1) {
			content.value = res.data.content
			uni.setNavigationBarTitle({
				title: res.data.title
			});
		}
	}
</script>

<style lang="scss">
	.gmzn {
		width: 100%;
		overflow: hidden;
	}
</style>